package com.example.nio.jvm;

import java.util.concurrent.CountDownLatch;

public class InterruptExample {

    static CountDownLatch countDownLatch = new CountDownLatch(2);

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(()->{
            try {
                countDownLatch.await();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(1);
        });
        thread.start();
        Thread.sleep(1000L);
        thread.interrupt();



    }

}
